<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title> 
<script type="text/javascript" src="http://htmlcolor.duapp.com/js/yui-min.js"></script>
<link rel="stylesheet" type="text/css" href="http://htmlcolor.duapp.com/styles/color-min.css" />
</head>
<body>
<div class="bodybg">
            <div class="bg">
                <div class="bg1">
                    <div class="top font18"><strong>HTML色彩代码</strong></div>
                    <div id="insertcolor">
                        插入您的色彩代码：
                        <input type="text" name="startcolor" id="startcolor" value="FFFFFF" maxlength="7">
                            <button id="newcolor">查看</button>
                    </div>
                    <div id="container"></div>
                    <script type="text/javascript" src="js/yui-min.js"></script>
                    <script type="text/javascript" language="javascript">
                        (function() {
                            var Event = YAHOO.util.Event, picker, hexcolor;
                            Event.onDOMReady(function() {
                                picker = new YAHOO.widget.ColorPicker("container", {
                                    showhsvcontrols: true,
                                    showhexcontrols: true,
                                    showwebsafe: false });
                                picker.skipAnim=true;
                                var onRgbChange = function(o) {
                                    setTimeout ("document.getElementById('yui-picker-hex').select()", 50);
                                }
                                picker.on("rgbChange", onRgbChange);
                                Event.on("newcolor", "click", function(e) {
                                    hexcolor = cc(document.getElementById('startcolor').value);
                                    picker.setValue([HexToR(hexcolor), HexToG(hexcolor), HexToB(hexcolor)], false);
                                });
                            });
                        })();
                    </script>
                </div>
            </div>
        </div>
</body>
</html>
